import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/display.css';
import 'element-ui/lib/theme-chalk/index.css';
import 'element-ui/lib/theme-chalk/base.css';


import axios from "axios";
import QS from "qs";
import { get , post } from './axios/http.js'
import router from './router'
import App from './App.vue'
import vantaImg from './components/vanta'
Vue.component('vanta-img',vantaImg)



//携带header的Authorization的token
// axios.interceptors.request.use(config => {
//   config.headers.Authorization = window.sessionStorage.getItem('token')
//   console.log(config)
//   config.headers.Authorization=window.sessionStorage.getItem('token')
//   return config
// })

Vue.config.productionTip = false

Vue.use(ElementUI);

Vue.prototype.$post = post;
Vue.prototype.$get = get;

new Vue({
  router,
  render: function (h) { return h(App) }
}).$mount('#app')

// axios.interceptors.request.use(config => {
//   // 为请求头添加Authorization字段为服务端返回的token
//   config.headers.Authorization = localStorage.getItem('token')
//   // return config是固定用法 必须有返回值
//   return config
// })
